// DynamicView.cpp : implementation file
//

#include "stdafx.h"
#include "TestAnaly.h"
#include "StandardView.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CStandardView

IMPLEMENT_DYNCREATE(CStandardView, CFormView)

CStandardView::CStandardView()
	: CFormView(CStandardView::IDD)
{
	//{{AFX_DATA_INIT(CStandardView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_bInit = false;
}

CStandardView::~CStandardView()
{
}

void CStandardView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStandardView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CStandardView, CFormView)
	//{{AFX_MSG_MAP(CStandardView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
	ON_WM_HSCROLL()
	ON_WM_VSCROLL()
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStandardView diagnostics

#ifdef _DEBUG
void CStandardView::AssertValid() const
{
	CFormView::AssertValid();
}

void CStandardView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CStandardView message handlers

void CStandardView::OnDraw(CDC* /*pDC*/)
{
	// TODO: Add your specialized code here and/or call the base class
	if( !m_bInit )
	{
		return;
	}

	DDOnDraw();
}

void CStandardView::DDOnDraw()
{
	POINT tScrollPos      = (POINT)GetScrollPosition();

	zkImgDraw xImgDraw;
	xImgDraw.nScrollx    = tScrollPos.x;
	xImgDraw.nScrolly    = tScrollPos.y;
	xImgDraw.fZoomFactor = 1;

	m_pMainFrame->m_pToolView->m_ImgAnaly.Draw(&xImgDraw);

// 	HDC hDc = ::GetDC(this->m_hWnd);
// 
// 	GDIOnDraw(hDc);
// 
// 	::ReleaseDC(m_hWnd, hDc);
}
void CStandardView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: Add your message handler code here and/or call default

	CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}

void CStandardView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: Add your message handler code here and/or call default

	CFormView::OnVScroll(nSBCode, nPos, pScrollBar);
}
